﻿using System;
using com.guojin.core.io;
using com.guojin.core.io.message;

namespace com.guojin.mj.net.message.club
{
    public class ClubInvitPlayerJoinGameReq : Message
    {
        public static int TYPE = 7;
        public static int ID = 51;

        private string _roomId;   // 邀请玩家进入的房间
        private int[] _playerIdArray = new int[] {}; // 被邀请玩家的ID(有可能一次邀请多个);

        public static ClubInvitPlayerJoinGameReq Create(string roomId, int[] playerIdAarray)
        {
            ClubInvitPlayerJoinGameReq ipr = new ClubInvitPlayerJoinGameReq();
            ipr.RoomId = roomId;
            ipr._playerIdArray = playerIdAarray;
            return ipr;
        }

   

        public int[] PlayerIdArray
        {
            get
            {
                return _playerIdArray;
            }

            set
            {
                _playerIdArray = value;
            }
        }

        public string RoomId
        {
            get { return _roomId; }
            set { _roomId = value; }
        }

        public void decode(Input _in)
        {
        }

        public void encode(Output _out)
        {
            _out.writeString(RoomId);
            _out.writeIntArray(_playerIdArray);
        }

        public int getMessageId()
        {
            return ID;
        }

        public int getMessageType()
        {
            return TYPE;
        }

        public string toString()
        {
            return string.Format("roomIDTex= {0}, playerIdArray={1}",RoomId,_playerIdArray[0]);
        }
    }
}